#ifndef GAMEENGINE_GAMEPLAY_OBJECTS_OBJECT_BASE_H
#define GAMEENGINE_GAMEPLAY_OBJECTS_OBJECT_BASE_H

#include <GameEngine/Gameplay/gameplay_settings.h>

#include <GameEngine/Core/Classes/rtti.h>
#include <GameEngine/Core/string.h>

#include <QtCore/QObject>
#include <QtCore/QUuid>


#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif

//=================================================================================


//! A generic object
/*!
 *  A generic object provides a unique ID that allows the object to be recognized from
 *  any kind of context, a name that is generally intended to be the human-readable
 *  identity of the object (even though nothing forbids several objects to share the
 *  same name), and an active state that indicate if the object is currently active in
 *  the game or not.
 */
class _Gameplay_decl ObjectBase : public QObject {
	GAMEENGINE_DECLARE_RTTI_SINGLE(ObjectBase)
	Q_OBJECT

public:
	//! Typedef that handles objects IDs
	typedef QUuid ObjectID;

	ObjectBase();
	ObjectBase(const ObjectBase& rhs);
	ObjectBase& operator=(const ObjectBase& rhs);
	virtual ~ObjectBase();

public:
	void set_name(const GEString& name);
	const GEString& name() const;

	void set_active(bool active);
	bool active() const;

	const ObjectID& id() const;

protected:
	void set_id(const ObjectID& id);

protected:
	//! The name of the object
	GEString name_;

	//! State of the object
	bool active_;

	//! The unique ID of the object
	ObjectID id_;
};

//========================================================

#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif

#endif
